<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <h3 class="panel-title">每日工作报工详情</h3>
    </div>
    <div class="panel-body">
        <div class="row">
            <div class="col-md-12">
                <table class="table table-striped">
                    <tr>
                        <th width="120">工作日期</th>
                        <td>{$row.work_date|default="--"}</td>
                    </tr>
                    <tr>
                        <th>状态</th>
                        <td>
                            {if $row.status == 0}
                                <span class="label label-warning">待审核</span>
                            {elseif $row.status == 1}
                                <span class="label label-success">通过</span>
                            {elseif $row.status == 2}
                                <span class="label label-danger">拒绝</span>
                            {/if}
                        </td>
                    </tr>
                    <tr>
                        <th>备注</th>
                        <td>{$row.remark|default="--"}</td>
                    </tr>
                    <tr>
                        <th>审核原因</th>
                        <td>{$row.audit_reason|default="--"}</td>
                    </tr>
                    <tr>
                        <th>创建时间</th>
                        <td>{$row.createtime_text}</td>
                    </tr>
                    <tr>
                        <th>更新时间</th>
                        <td>{$row.updatetime_text}</td>
                    </tr>
                </table>
            </div>
        </div>

        <div class="row">
            <div class="col-md-12">
                <h4>工作项目详情</h4>
                <div class="table-responsive">
                    <table class="table table-striped table-bordered">
                        <thead>
                            <tr>
                                <th>订单号</th>
                                <th>产品名称</th>
                                <th>型号</th>
                                <th>工序</th>
                                <th>数量</th>
                                <th>工时</th>
                                <th>工作描述</th>
                                <th>图片</th>
                            </tr>
                        </thead>
                        <tbody>
                            {volist name="row.workitems" id="item"}
                            <tr>
                                <td>{$item.order_info.order_no|default="--"}</td>
                                <td>{$item.model_info.product_name|default="--"}</td>
                                <td>{$item.model_info.name|default="--"}</td>
                                <td>{$item.process_info.name|default="--"}</td>
                                <td>{$item.quantity}</td>
                                <td>{$item.work_hours}小时</td>
                                <td>{$item.work_description}</td>
                                <td>
                                    {volist name="item.images" id="image"}
                                    <a href="{$image.image_url}" target="_blank" class="thumbnail" style="display: inline-block; width: 50px; height: 50px; margin: 2px;">
                                        <img src="{$image.image_url}" style="width: 100%; height: 100%; object-fit: cover;">
                                    </a>
                                    {/volist}
                                </td>
                            </tr>
                            {/volist}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <div class="col-sm-12">
                        <a class="btn btn-default" href="javascript:history.back(-1);">返回</a>
                        {if $row.status == 0}
                        <a class="btn btn-primary" href="{:url('audit', ['ids' => $row.id])}">审核</a>
                        {/if}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
